package leecode

type WordsFrequency struct {
	hashMap map[string]int
}

func Constructor1602(book []string) WordsFrequency {
	hashMap := make(map[string]int)
	for i := 0; i < len(book); i++ {
		hashMap[book[i]]++
	}
	return WordsFrequency{hashMap}
}

func (this *WordsFrequency) Get(word string) int {
	return this.hashMap[word]
}
